package com.wswy.wzcx.ui.pay

import com.wswy.wzcx.model.coupon.CouponModel
import com.wswy.wzcx.utils.StringUtils
import kotlinx.android.parcel.IgnoredOnParcel
import java.math.BigDecimal

open class PayBaseData {

    @IgnoredOnParcel
    var couponFee: BigDecimal?=null //红包金额
    private set

    @IgnoredOnParcel
    var couponId:Long = 0  //红包
    private set

    @IgnoredOnParcel
    var couponModel: CouponModel?=null
    private set

    @IgnoredOnParcel
    var payStyle = 0   //支付方式



    open fun setCoupon(id:Long,num:String?,couponModel: CouponModel?){
        couponFee = StringUtils.parseToMoney(num)
        couponId = id
        this.couponModel = couponModel
    }

    fun hasCouponFee() = couponFee?.toFloat()?:0.0f > 0
}